public class Test {
    public static void main(String[] args) {
        Thread t3 = new Thread(() -> {
            System.out.print(Thread.currentThread().getName());
        },"C");
        Thread t2 = new Thread(() -> {
            try {
                t3.join();
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
            System.out.print(Thread.currentThread().getName());
        },"B");
        Thread t1 = new Thread(() -> {
            try {
                t2.join();
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
            System.out.print(Thread.currentThread().getName());
        },"A");
        t1.start();
        t2.start();
        t3.start();
    }
}
